#ifndef NETWORKFILE_H
#define NETWORKFILE_H
#include "QObject"
#include "QHostAddress"
#include "QFile"
#include "QtNetwork/QUdpSocket"
#include "QTimer"

#define START (qint64)-3
#define OVER (qint64)-1
#define OK (qint64)-2


class NetWorkFile: public QObject
{
    Q_OBJECT
public:
    explicit NetWorkFile();
    ~NetWorkFile();

    void sendFile(QHostAddress ip);

private:
    QUdpSocket *network;

    QFile *FileS;
    QFile *FileG;
    qint64 tobytes;
    qint64 pack;
    qint64 MOD;
    QTimer *timer;
    QHostAddress sendip,getip;

    QHostAddress myip();
    QString filename;

    QByteArray outlock;



private slots:
    void makeconnect();
    void sendagain();
    void readdata();
    void senddata();
    void checkpack();


public:

};

#endif // NETWORKFILE_H
